﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using SL4PopupMenu;

namespace MvvmTreeView
{
    public class CheckBoxContextMenuItem : ContextMenuItem, ICheckBoxContextMenuItem
    {
        public bool IsChecked { get; set; }
        public event MenuCheckChangedHandler MenuCheckChanged;
        public string CheckBoxGroup { get; set; }

        public CheckBoxContextMenuItem()
        {
        }

        public void RaiseMenuCheckChanged(object sender, MenuCheckedEventArgs args)
        {
            MenuCheckChanged(sender, args);
        }

        public CheckBoxContextMenuItem(string id, string iconUrl, string text, string tag, bool isChecked, MenuCheckChangedHandler checkChangedHandler) : base(id, iconUrl, text, tag, null)
        {
            this.MenuCheckChanged += checkChangedHandler;
            this.CheckChanged = checkChangedHandler;
        }

        public MenuCheckChangedHandler CheckChanged
        {
            set
            {
                MenuCheckChanged += value;
            }
        }
    }
}
